<?
require("config.php");
$listfield1 = "region";
$listfield2 = "carrier";
$listfield3 = "weightfrom";
$listfield4 = "weightto";
$listfield5 = "charge";



require($rela_path . "inc/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
<br>

<table width="95%" border="0" align="center">
  <tr> 
    <td valign="top">


        <table border="0" cellspacing="1" cellpadding="1">
          <tr><td width="50%">
		  
<?if (!$addrecord) {?>

<form name="forma1" method="post">

        <table border="0" cellspacing="1" cellpadding="1">
          <tr> 
            <td>&nbsp;</td>
            <td>
			<a href="add.php?Start_Num=<?=$Start_Num?>&Search=<?=urlencode($Search)?>"><img src="<?print($rela_path)?>images/bt_add.gif" border="0"></a>
			</td>

			<td><img src="<?print($rela_path)?>images/shim.gif" width=30></td>

          </tr>
        </table>

</form>


<?}?>

</td><td align="right">
<?
	$select='';
	$sql="select distinct region,regionc from med_shipping where cid=0 order by region ASC";
	$r=myQuery($sql);
	for($i=0;$i<count($r);$i++) {
		if ($Search==$r[$i][0]) $s=' selected';
			else $s='';
		$select.='<option value="'.$r[$i][0].'"'.$s.'>'.$r[$i][0].'</option>';
	}
?>

        <table border="0" cellspacing="1" cellpadding="1">
          <tr>
            <td>
			<form action="" method="post" name="region" id="region">
						  Select your region:
						  <select name="Search" onChange="document.region.submit();">
						  <?=$select?>
						    </select>
						</form>
			</td>
          </tr>
        </table>

			</td>
          </tr>
        </table>

<?
$sql="select value from misc_data where name='express';";
$r=myQuery($sql);
?>

<form action="../../inc/mod_rate.php" method="post" name="extra" id="extra">
  Express extra Rate 
  <input name="Rate" type="text" id="Rate" size="3" value="<?=$r[0][0]?>"> 
  %
  <input name="Submit" type="submit" onClick="MM_validateForm('Rate','','RinRange0:999');return document.MM_returnValue" value="Modify">
  <input type="reset" name="Reset" value="Reset">
</form>

<?require($rela_path . "inc/list5.php")?>

</td>

  </tr>
</table>
<br>
<br>
<br>
<?
require($rela_path . "inc/footer.php");
?>
